CC = gcc
EXE = CHosts
CFLAGS = -std=gnu11
OBJS = main.o resource.o grid.o func.o
LIBS = -LD:\Programs\mingw64\opt\lib
LIBS += -lcomctl32 -lregex -lwininet

$(EXE): $(OBJS)
	$(CC) $(CFLAGS) -mwindows -municode $^ -o $@ $(LIBS)
	
upx:
	upx CHosts.exe

clean:
	del *.o
	del *.exe

main.o: main.c grid.h func.h
	$(CC) $(CFLAGS) -c main.c

grid.o: grid.c
	$(CC) $(CFLAGS) -c grid.c

func.o: func.c
	$(CC) $(CFLAGS) -ID:\Programs\mingw64\opt\include -c func.c

resource.o: resource.rc manifest.xml favicon.ico
	windres -i resource.rc -o resource.o

